<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>map</title>
</head>
<body>
    <script>
        
        // 优雅的条件判断

        let a = new Map([
            ["1",["success","successPage"]],
            ["2",["fail","failPage"]],
            ["error",["error","errorPage"]]
        ]);

        let fn = (statusCode)=>{
            let code = a.get(statusCode) || a.get("error");
            console.log(code[0]);
            console.log(code[1]);
        }

       // fn("2");


       // console.log(toString.call(a));


        


        
    </script>
</body>
</html>